import search from "./search/search.js";
import approved from "./approved/approved.vue";
import toBeSubmitted from "./toBeSubmitted/toBeSubmitted.vue";
import toBereviewed from "./toBereviewed/toBereviewed.vue";

export default {
    mixins: [search],
    components: {
        approved,
        toBeSubmitted,
        toBereviewed,
    },
    data() {
        return {
            keyName: "1",
            tab: {
                approved: "全部",
                toBeSubmitted: "营业中",
                toBereviewed: "下线中",
            },
        }
    },
    mounted() {
        this.getList()
    },
    methods: {
        callback(key) {
            this.keyName = key
            switch (key) {
                case '1':
                    this.$refs.approved.getList() //全部列表
                    break;
                case '2':
                    this.$refs.toBeSubmitted.getList() //营业中列表
                    break;
                case '3':
                    this.$refs.toBereviewed.getList() //下线中列表
                    break;
                default:
                    break;
            }
        },
        getList() {
            this.$refs.approved.getList()       //全部列表
            this.$refs.toBeSubmitted.getList()  //营业中列表
            this.$refs.toBereviewed.getList() //下线中列表
        },
        addShangpin() {
            this.$router.push({path:'/shop/info/addShop'})
        },
    }
}